<%-- 
    Document   : managefaculty
    Created on : Jan 21, 2012, 10:59:47 AM
    Author     : Ketsaraporn
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html:html>
    <head>
        <script type="text/javascript" src="js/function.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/function.js"></script>
        <title>Manage Location</title>
        <script>
            function goSelected() {
                document.manageFacultyForm.submit();
                redirect("${pageContext.request.contextPath}/manageFaculty.do?dispatch=doManageFaculty","_top");
            }
        </script>
    </head>
    <body>
        <html:form method="post" action="/manageFaculty.do?dispatch=doNewFaculty">
            <div class="content">
                <table class="three" cellspacing="0">
                    <tr>
                        <td width="87">คณะ :</td>
                        <td width="687">
                            <html:select property="facultyEntity.facId" onchange="goSelected();">
                                <html:option value="">--กรุณาเลือก--</html:option>
                                <html:optionsCollection property="facultyList" label="facName" value="facId"></html:optionsCollection>
                            </html:select> 
                        </td>
                    </tr>
                    <tr>
                        <td width="87">ภาควิชา :</td>
                        <td width="687">
                            <html:select property="departmentEntity.depId" onchange="goSelected();">
                                <html:option value="">--กรุณาเลือก--</html:option>
                                <html:optionsCollection property="departmentList" label="depName" value="depId"></html:optionsCollection>
                            </html:select> 
                        </td>
                    </tr>
                    <tr>
                        <td width="87">สาขา :</td>
                        <td width="687">
                            <html:select property="branchEntity.braId" onchange="goSelected();">
                                <html:option value="">--กรุณาเลือก--</html:option>
                                <html:optionsCollection property="branchList" label="braName" value="braId"></html:optionsCollection>
                            </html:select> 
                        </td>
                    </tr>
                    <tr>
                        <td width="87">หลักสูตร :</td>
                        <td width="687">
                            <html:select property="programEntity.proId" onchange="goSelected();" >
                                <html:option value="">--กรุณาเลือก--</html:option>
                                <html:optionsCollection property="programList" label="proName" value="proId"></html:optionsCollection>
                            </html:select> 
                        </td>
                    </tr>
                    <tr>
                        <td width="87">&nbsp;</td>
                        <td width="687">
                            <html:submit property="btnSave" value="แสดงผลลัพธ์"/> </td>
                    </tr>            
                </table>  

                <table class="three" cellspacing="0">


                    <tr>
                        <td colspan="3">&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3"><strong>แสดงข้อมูลการค้นหา</strong></td>
                        <td><div id="linkbuttom"><a href="${pageContext.request.contextPath}/manageFaculty.do?dispatch=doPrePare">เพิ่ม</a></div></td>
                    </tr>
                    <tr>
                        <th width="52">ลำดับ</th>
                        <th width="118">รหัส</th>
                        <th width="527">ชื่อ</th>
                        <th width="73">การจัดการ</th>
                    </tr>                
                    <logic:iterate id="list" name="manageFacultyForm" property="dtoList" indexId="seq">
                        <tr>   
                            <td><div align="left">${seq + 1}</div></td>
                            <td><div align="left">${list.id}</div></td>
                            <td><div align="left">${list.name}</div></td>
                            <td><div id="linkbuttom">
                                    <a href="${pageContext.request.contextPath}/manageFaculty.do?dispatch=doPrePare&mode=edit&id=${list.id}"><u>แก้ไข</u></a> | 
                                    <a href="${pageContext.request.contextPath}/manageFaculty.do?dispatch=doDelete&id=${list.id}" onclick="return confirm('ต้องการลบข้อมูลใช่หรือไม่?');"><u>ลบ</u></a>                                                                                                                                                                             
                                </div>
                            </td>
                        </tr>
                    </logic:iterate>
                </table>             
            </div>  
        </html:form>       
    </body>
</html:html>
